Leapfrog integration

Leapfrog integration is a simple method for numerically integrating differential equations of the form

\ddot x=F(x),

or equivalently of the form

\dot v=F(x),\;\dot x \equiv v,

particularly in the case of a dynamical system of classical mechanics. Such problems often take the form

\ddot x=-\nabla V(x),

with energy function

E(x,v)=\tfrac12|v|^2%2BV(x),

where V is the potential energy of the system. The method is known by different names in different disciplines. In particular, it is similar to the Velocity Verlet method, which is a variant of Verlet integration. Leapfrog integration is equivalent to updating positions x(t) and velocities v(t)=\dot x(t) at interleaved time points, staggered in such a way that they 'leapfrog' over each other. For example, the position is updated at integer time steps and the velocity is updated at integer-plus-a-half time steps.

Leapfrog integration is a second order method, in contrast to Euler integration, which is only first order, yet requires the same number of function evaluations per step. Unlike Euler integration, it is stable for oscillatory motion, as long as the time-step, \Delta t < 1/\omega[1].

In leapfrog integration, the equations for updating position and velocity are

\begin{align}
  x_i   &= x_{i-1} %2B v_{i-1/2}\, \Delta t , \\[0.4em]
  a_i &= F(x_i) \\[0.4em]
  v_{i%2B1/2} &= v_{i-1/2} %2B a_{i}\, \Delta t ,
\end{align}

where x_i is position at step i, v_{i%2B1/2\,} is the velocity, or first derivative of x, at step i%2B1/2\,, a_{i}=F(x_i) is the acceleration, or second derivative of x, at step i and \Delta t is the size of each time step. These equations can be expressed in a form which gives velocity at integer steps as[2]

\begin{align}
  x_{i%2B1} &= x_i %2B v_i\, \Delta t %2B \tfrac{1}{2}\,a_i\, \Delta t^{\,2}  , \\[0.4em]
  v_{i%2B1} &= v_i %2B \tfrac{1}{2}\,(a_i %2B a_{i%2B1})\,\Delta t  .
\end{align}

One use of this equation is in gravity simulations, since in that case the acceleration depends only on the positions of the gravitating masses, although higher order integrators (such as Runge–Kutta methods) are more frequently used.

There are two primary strengths to Leapfrog integration when applied to mechanics problems. The first is the time-reversibility of the Leapfrog method. One can integrate forward n steps, and then reverse the direction of integration and integrate backwards n steps to arrive at the same starting position. The second strength of Leapfrog integration is its symplectic nature, which implies that it conserves the (slightly modified) energy of dynamical systems. This is especially useful when computing orbital dynamics, as other integration schemes, such as the Runge-Kutta method, do not conserve energy and allow the system to drift substantially over time.

Because of its time-reversibility, and because it is a symplectic integrator, leapfrog integration is also used in Hamiltonian Monte Carlo, a method for drawing random samples from a probability distribution whose overall normalization is unknown.[3]

See also

References

  1. ^ The Leap-Frog Method
  2. ^ 4.1 Two Ways to Write the Leapfrog
  3. ^ Bishop, Christopher (2006). Pattern Recognition and Machine Learning. New York: Springer-Verlag. pp. 548-554. ISBN 978-0387-31073-2. 

External Links